/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package technotheist.data.wrap;

import technotheist.data.BBuffer;

/**
 *
 * @author Mitch
 */
public class BMatrix2D<T> extends BBufferWrapper<T> {
    private final int X;
    private final int Y;

    public BMatrix2D(BBuffer<T> parent, int X, int Y) {
	super(parent);
	this.X = X;
	this.Y = Y;
    }

    public T s(int x, int y) {
	return s(x * Y + y);
    }

    public void s(int x, int y, T v) {
	s(x * Y + y, v);
    }
    
    public BSubBuffer<T> createSubBuffer(int x) {
	return new BSubBuffer<>(this, Y, x * Y);
    }
}
